{extend name="public:layout" /}
{block name="title"}添加规则{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> <a href="{:url('index',['utype'=>$Request.param.utype])}"> 规则列表</a></li>
                <li class="active">添加规则</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">上级规则</label>
                    <div class="col-sm-4">
                        <select name="rule_pid" class="form-control">
                            <option value="0">顶级规则</option>
                            {volist name="authRuleList" id="vo"}
                            <option value="{$vo.rule_id}"
                                    {eq name="vo.rule_id" value="$Request.param.pid" }selected{/eq}>{$vo._name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">规则名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="title" value=""/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">模块</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="module" value=""/>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">控制器</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="controller" value=""/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">行为</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" name="action" value=""/>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">附件参数</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control"
                               name="condition" value=""/>
                    </div>
                </div>


                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">菜单</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="ismenu" value="1" checked /> 是
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="ismenu" value="0" /> 否
                        </label>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">图标</label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input type="text" class="form-control" name="icon" id="icon" value=""/>
                            <span class="input-group-addon" id="selectIcon">选择图标</span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">排序</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control"
                               name="rule_sort" value="0"/>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">状态</label>
                    <div class="col-sm-4">
                        <div class="switch form-control-static">
                            <div class="onoffswitch">
                                <input type="checkbox" checked name="status" value="1" class="onoffswitch-checkbox" id="example1">
                                <label class="onoffswitch-label" for="example1">
                                    <span class="onoffswitch-inner"></span>
                                    <span class="onoffswitch-switch"></span>
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button class="btn btn-primary" type="button" id="btnSub">保存内容</button>
                        <a href="{:url('index',['utype'=>$Request.param.utype])}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub');
        In('layer',function(){
            $('#selectIcon').click(function () {
                layer.open({
                    title: '选择图标',
                    type: 2,
                    area: ['800px', '480px'],
                    content: "{:url('icon')}"
                });
            });
        })
    })
</script>
{/block}